Thermal mitigation using selective task modulation

ABSTRACT

A method and apparatus of a device that manages a thermal profile of a device by selectively throttling central processing unit operations of the device is described. The device monitors the thermal profile of the device, where the device executes a plurality of tasks that utilizes a central processing unit of the device. In addition, the plurality of tasks includes a high QoS task and a low QoS process. If the thermal profile of the device exceeds a thermal threshold, the device increases a first CPU throttling for the low QoS task and maintains a second CPU throttling for the high QoS task. The device further executes the low QoS task using the first CPU utilization with the first processing core of the CPU by selectively forcing an idle of the low QoS task during an execution window. In addition, the device executes the high QoS task using the second CPU throttling with a second processing core of the CPU.

RELATED APPLICATIONS

Applicant claims the benefit of priority of prior, provisionalapplication Ser. No. 62/006,004 filed May 30, 2014, the entirety ofwhich is incorporated by reference.

FIELD OF INVENTION

This invention relates generally to device thermal management and moreparticularly to managing device thermal management by selectivethrottling of the device central processing unit.

BACKGROUND OF THE INVENTION

A device can typically include one or more central processing units(CPU) that are used to process a wide variety of instructions for thedevice. Each of the CPUs is hardware that carries out the instructionsof a program by performing the basic arithmetical, logical, andinput/output operations of the device. For example, the CPU can be usedto process different tasks that are running on the device.

Each of these CPU operations will cause the device to consume power thatleads to heat being generated by the device. This generated heat can addto a thermal load being applied to the device. An excessive thermal loadcan affect the device performance and, in extreme cases, can lead to adevice shutdown. Existing devices can mitigate the thermal load byreducing the CPU operations globally for all processes, regardless ofwhether the CPU operations are for a batch process or a processsupporting a user interface operation.

SUMMARY OF THE DESCRIPTION

A method and apparatus of a device that manages a thermal profile of adevice by selectively throttling central processing unit operations ofthe device is described. In an exemplary embodiment, the device monitorsthe thermal profile of the device, where the device executes a pluralityof processes that utilizes a central processing unit of the device. Inaddition, the plurality of tasks includes a high QoS task and a low QoStask. If the thermal profile of the device exceeds a thermal threshold,the device increases a first CPU throttling for the low QoS task andmaintains a second CPU throttling for the high QoS task. The devicefurther executes the low QoS task using the first CPU utilization withthe first processing core of the CPU by selectively forcing an idle ofthe low QoS task during an execution window. In addition, the deviceexecutes the high QoS task using the second CPU throttling with a secondprocessing core of the CPU.

In another embodiment, the device manages a thermal profile of thedevice by overlapping the forced idle times of low QoS tasks. In thisembodiment, the device monitors the thermal level of the thermal profileof the device, where the device is executing a plurality of tasks thatutilize a plurality of processing cores of the device. In addition, theplurality of tasks include multiple low QoS tasks. The device schedulesthe plurality of tasks on the plurality of processing cores for anexecution window, where each of the multiple low QoS tasks areselectively forced idled during the execution window and the forcedidled times of the multiple low QoS tasks overlap. The device furtherexecutes the plurality of tasks.

In a further embodiment, the device manages a thermal profile of thedevice by adjusting a throttling a central processing unit execution ofa historically high energy consuming task. In this embodiment, thedevice monitors thermal level of the thermal profile of the device,where the device is executing a plurality of tasks that utilize aplurality of processing cores of the device. If the thermal level of thedevice exceeds a thermal threshold, the device identifies one of theplurality of tasks as a historically high energy consuming task, andthrottles this historically high energy consuming task by setting aforce idle execution time for the historically high energy consumingtask. The device further executes the plurality of tasks.

In another embodiment, the device manages a thermal profile of thedevice by adjusting a processing core execution frequency based on thethermal load of the device. In this embodiment, the device monitorsthermal level of the thermal profile of the device, where the device isexecuting a plurality of tasks that utilize a plurality of processingcores of the device. The device further schedules the plurality of tasksto be executed on the plurality of processing cores during an executionwindow. In addition, the device sets a processing frequency for each ofthe plurality of processing cores based one of the plurality of tasksscheduled to be executed on that processing core and the thermal levelof the device. The device additionally executes each of the plurality oftasks using the plurality of the processing cores with the correspondingprocessing frequency.

Other methods and apparatuses are also described.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and notlimitation in the figures of the accompanying drawings in which likereferences indicate similar elements.

FIG. 1 is a block diagram of one embodiment of a device that mitigates athermal profile of a device by selectively throttling central processingunit (CPU) operations of the device.

FIG. 2 is a block diagram of a CPU with multiple CPU processing coresand supporting hardware.

FIG. 3 is an illustration of one embodiment of CPU core executiontimelines that include selective forced idle for low QoS tasks.

FIG. 4 is an illustration of one embodiment of CPU core executiontimelines that are phase aligned with overlapping selective forced idlefor low QoS tasks.

FIG. 5 is an illustration of a table of selective force idle percentagesfor different levels of CPU throttling.

FIG. 6 is an illustration of execution windows for two different taskswith selective force idling applied to these tasks.

FIG. 7 is a flow diagram of one embodiment of a process to manage CPUthrottling based on the thermal level of the device.

FIG. 8 is a flow diagram of one embodiment of a process to manage CPUthrottling for a high energy consuming task based on the thermal levelof the device.

FIG. 9 is a flow diagram of one embodiment of a process to schedule andexecute tasks using CPU throttling.

FIG. 10 is a flow diagram of one embodiment of a process to phase aligntasks that are selective forced idle on different CPU cores.

FIG. 11 is a flow diagram of one embodiment of a process to manage CPUfrequency ceilings based on the thermal level of the device.

FIG. 12 is an illustration of a table of frequency ceiling percentagesfor different levels of CPU throttling.

FIG. 13 is a flow diagram of one embodiment of a process to set a CPUfrequency ceiling for a task on a CPU core.

FIG. 14 is a block diagram of one embodiment of a CPU management moduleto manage CPU throttling based on the thermal level of the device.

FIG. 15 is a block diagram of one embodiment of a CPU scheduler toschedule and execute tasks using CPU throttling.

FIG. 16 is a block diagram of one embodiment of a frequency ceilingmanagement module to manage CPU frequency ceilings based on the thermallevel of the device.

FIG. 17 is a block diagram of one embodiment of a frequency ceilingmodule to set a CPU frequency ceiling for a task on a CPU core.

FIG. 18 illustrates one example of a typical computer system, which maybe used in conjunction with the embodiments described herein.

FIG. 19 shows an example of a data processing system, which may be usedwith one embodiment of the present invention.

DETAILED DESCRIPTION

A method and apparatus of a device that manages a thermal profile of adevice by selectively throttling central processing unit operations ofthe device is described. In the following description, numerous specificdetails are set forth to provide thorough explanation of embodiments ofthe present invention. It will be apparent, however, to one skilled inthe art, that embodiments of the present invention may be practicedwithout these specific details. In other instances, well-knowncomponents, structures, and techniques have not been shown in detail inorder not to obscure the understanding of this description.

Reference in the specification to “one embodiment” or “an embodiment”means that a particular feature, structure, or characteristic describedin connection with the embodiment can be included in at least oneembodiment of the invention. The appearances of the phrase “in oneembodiment” in various places in the specification do not necessarilyall refer to the same embodiment.

In the following description and claims, the terms “coupled” and“connected,” along with their derivatives, may be used. It should beunderstood that these terms are not intended as synonyms for each other.“Coupled” is used to indicate that two or more elements, which may ormay not be in direct physical or electrical contact with each other,co-operate or interact with each other. “Connected” is used to indicatethe establishment of communication between two or more elements that arecoupled with each other.

The processes depicted in the figures that follow, are performed byprocessing logic that comprises hardware (e.g., circuitry, dedicatedlogic, etc.), software (such as is run on a general-purpose computersystem or a dedicated machine), or a combination of both. Although theprocesses are described below in terms of some sequential operations, itshould be appreciated that some of the operations described may beperformed in different order. Moreover, some operations may be performedin parallel rather than sequentially.

The terms “server,” “client,” and “device” are intended to refergenerally to data processing systems rather than specifically to aparticular form factor for the server, client, and/or device.

A method and apparatus of a device that manages a thermal profile of adevice by selectively throttling central processing unit (CPU)operations of the device is described. In one embodiment, the deviceselectively throttles the CPU operations by selectively force idlingone, some, or all of the running tasks, so that the overall CPUutilization and thermals levels is reduced, but that the CPU operationsfor higher quality of service (QoS) tasks are not affected or areaffected less than CPU operations for lower QoS processes. In oneembodiment, the device monitors the thermal level of the device. If thethermal level reaches or exceeds one or more thermal thresholds, thedevice selectively throttles the CPU operations using the selectiveforced idling for the different tasks. Selectively force idling a taskmeans idling the task for part or all of an execution window of the taskby a processing core of the CPU that is executing the task. When a taskis scheduled to be executed by a CPU processing core, this processingcore executes the task for a time defined by the execution window.Without a selective forced idling, the task would be executed normallyduring this window, except for times in which the task idles based on atask instruction. By forcing an idle, the operating system isdesignating a time during the execution window in which the task isidled. This task idling preserves power and reduces the thermal load onthe device. In this embodiment, each task operation has a QoS. Each QoSrepresents whether the task is an important process that should not bethrottled (or throttled under more of a thermal load) or the task can bea less important process that can be throttled under a lesser thermalload. For example and in one embodiment, a task associated with userinterface operation would have a higher QoS (e.g., graphic rendering fora UI or graphics visual, encoding/decoding for a video call, windowoperations, scrolling, realtime video encoding from a coupled capturedevice, realtime audio signal processing, video playback), whereas atask associated with a batch process (e.g., video transcoding, batchdecoding/encoding, search indexing, backup, filesystem indexing,software update downloads, filesystem encryption, cloud syncing,downloading email messages), would have a lower QoS. The device caninclude multiple different task quality of services (QoSes). Each of theQoSes has an associated selective forced idle percentage. The deviceselectively throttles overall device CPU usage forcing an idle during atask's execution window for the different QoSes based on the currentthermal load on the device. For example and in one embodiment, if thedevice thermal load increases, the device can increase the selectiveforced idling for the lowest or lower QoS tasks. This would decrease theCPU usage for these lower QoSes, but leave the CPU usage for the higherQoSes unchanged. As the thermal load on the device further increases,the device can either increase the selective forced idling of the lowerQoS tasks and/or start to throttle the higher QoS tasks. In anotherembodiment, as the thermal load on the device lessens, the device canselectively relax the CPU throttling for the different QoS tasks.

In one embodiment, a task is a process that is an instance of a computerprogram that is being executed. In this embodiment, the task may be auser application that is executing as a result of user input. Anotherexample of a task is a system process that provides one or more servicesto a user application, another system process, other process, etc. Forexample, in one embodiment, a system process gives a status of wirelesshotspot service, lists installed applications, facilitates a search,monitors and adjusts device power settings, etc. In another embodiment,a task is a thread that is the smallest sequence of programmedinstructions that can be managed independently by an operating systemscheduler. In one embodiment, a thread is contained inside a process.Multiple threads can exist within the same process and share resourcessuch as memory, while different processes do not share these resources.

As described above, and in one embodiment, selectively force idling atask during an execution window can reduce the power consumption andthermal load of device because the CPU processing core executing thattask can be put in a low power state. If all of the CPU processing coresof a CPU are idled, further thermal mitigation can be realized becauseadditional CPU supporting hardware can also be put in a low power state.In this embodiment, overlapping the selective forced idle times ofexecuting tasks can increase the probability that all of the CPUprocessing cores are idle during the same time. For example and in oneembodiment, for a four core CPU, consider a scenario where one core isexecuting a high QoS task, two core are executing low QoS tasks withselective forced idle times, and the fourth core is not executing atask. In this example, the selective forced idle times overlap, so thatif the high QoS task idles, all of the processing cores would idle atthe same time. By having all of the processing core of the CPU idle atthe same time, the support CPU hardware (e.g., memory controller, lastlevel cache, CPU interconnect, and other CPU support hardware) can alsobe put into a low power state and be power-gated, saving further power,eliminated leakage current, and further mitigating the thermal load onthe device. In one embodiment, if the high QoS task were a videoplayback task, the task would go idle on completion of a frame.

In one embodiment, the device determines a selective forced idle settingfor tasks that are historically high energy consuming tasks. In thisembodiment, if the thermal load on the device reaches an energyconsumption threshold, the device determines if there are any tasksrunning that are historically high energy consuming tasks. If there are,the device selectively idles these tasks. For example and in oneembodiment, a video encoding, decoding, or transcoding task mayhistorically consume a high enough energy that the device decides tothrottle this task by selectively force idling that task.

In one embodiment, the device can mitigate the thermal load on thedevice by setting a CPU frequency ceiling for the different CPUprocessing cores based on the QoS associated with each executing task.In this embodiment, the device sets a frequency ceiling percentage for atask QoS based on the current device thermal load. In one embodiment,the frequency ceiling percentage is the maximum percentage of the CPUprocessing core frequency that this CPU processing core can execute foran execution window. For example and in one embodiment, if a CPUprocessing core has a maximum frequency of 2.3 Ghz, a frequency ceilingpercentage of 50% of a task would restrict that processing core tooperating at 1.15 GHz. The actual processing core frequency can befurther reduced based on other power management functions of the device.

In a further embodiment, the operating system of the device assigns eachthread or task a quality-of-service (QoS) class. The class can beexplicitly advertised by the thread or task, or be implicitly inferredby the operating system. Inference is performed based on focality(foreground status) of the application in question, whether theapplication has been “app napped”, energy consumption history across theCPU, GPU, and input-output (IO) devices and other criteria. Explicitlyadvertised classes can include background, long-running batch jobs suchas filesystem indexing or encryption, backup, etc., with the gamut ofQoS ranging up to user-interactive and realtime execution such asscrolling and video/audio processing. The operating system arbitersbetween explicitly advertised and implicitly inferred classes.

In another embodiment, the operating system, when determining processorexecution frequency ceilings and the scheduling duty cycle to be appliedto a given thread, uses as inputs the quality-of-service of the threadand the thermal level of the device, with the goals of providingincreased performance to important tasks while simultaneouslycontrolling temperature to acceptable limits. In the case of CPUthrottling and selective duty cycling/forced idling, the primary thermallevel utilized is that of the CPU, the CPU's junction temperature asmeasured by an on-CPU thermal diode.

FIG. 1 is a block diagram of one embodiment of a device 100 thatmitigates a thermal profile of a device by selectively throttlingcentral processing unit (CPU) operations of the device. In oneembodiment, the device 100 can be a personal computer, laptop, server,mobile device (e.g., smartphone, laptop, personal digital assistant,music playing device, gaming device, etc.), network element (e.g.,router, switch, gateway, etc.), and/or any device capable of executingmultiple applications. In one embodiment, the device 100 can be aphysical or virtual device. In FIG. 1, the device 100 includes one ormore central processing units (CPUs) 108, an operating system 112, asystem management controller (SMC) 104, and sensors 106. In oneembodiment, the CPU 108 is a general-purpose processing device such as amicroprocessor or another type of processor and is coupled to theoperating system 112. More particularly, the CPU 108 may be a complexinstruction set computing (CISC) microprocessor, reduced instruction setcomputing (RISC) microprocessor, very long instruction word (VLIW)microprocessor, processor implementing other instruction sets, orprocessors implementing a combination of instruction sets. The centralprocessing unit (CPU) 108 may also be one or more special-purposeprocessing devices such as an application specific integrated circuit(ASIC), a field programmable gate array (FPGA), a digital signalprocessor (DSP), network processor, or the like. In one embodiment, theCPU 108 can include one or more CPUs and each of the CPUs can includeone or more processing cores.

In one embodiment, the operating system 112 is a set of software used tomanage device hardware resources and provides common services for otherrunning computer programs, such as application programs. In oneembodiment, the system management controller 104 is a subsystem thatcontrols the device power flow and fan speed. In this embodiment, thesystem management controller 104 couples to the sensors 106. In oneembodiment, the sensors 106 include sensor(s) that monitor and recorddata regarding the thermal profile of the device 100. In thisembodiment, the thermal profile is data about the thermalcharacteristics of the device 100. For example and in one embodiment,the thermal profile can include the device 100 temperature over time,device 100 module temperature over time (e.g., storage temperature, CPUjunction temperature, bottom case temperature of the device enclosure,fan speed, and/or other data related to the thermal characteristics ofthe device 100). In one embodiment, the sensors 106 are one or moresensors that measure the thermal characteristics of the device 100. Forexample and in one embodiment, the sensors 106 can include a sensor forthe device temperature, sensor for an I/O subsystem, discrete GPU, fanspeed sensor, and DRAM.

In one embodiment, the operating system 112 adjusts the operation of theCPU 108 to mitigate the thermal profile of the device 100. In thisembodiment, the operating system 112 includes a thermal daemon(thermald) 102 and kernel 110. In this embodiment, thermald 102 isdaemon that selectively throttles the CPU operations of one or morerunning tasks in order to mitigate the thermal environment of the device100. In one embodiment, thermald 102 receives the thermal level of thethermal profile and determines if the thermal level has crossed one ofone or more thermal thresholds. In one embodiment, the device can beconfigured for several different thermal thresholds, with each thermalthreshold having different CPU throttling levels. In this embodiment,crossing a thermal threshold can mean that thermald 102 adjusts a set ofselective forced idle time values for different QoS tasks. In thisembodiment, the selective forced idle time values are used by the CPU toschedule a CPU execution for a time slice of a task according to the QoSof that operation. Each task has an associated QoS that indicates therelative importance of how much of a CPU's execution window is to beused that task is executed by the CPU. Tasks with a higher QoS are morelikely to receive more CPU execution time than a lower QoS task. In oneembodiment, there can be a plurality of different QoSes (e.g., two ormore different QoSes). In one embodiment, under conditions of a lowthermal load of the device 100, each of the QoSes will have lowselective forced idle time. As the thermal load on the device 100increases, thermald 102 adjusts the QoS selective forced idle values ofone or more of the different task QoSes. In one embodiment, a thermalload on the device can increase because the power consumption of thedevice or one or more components of the device (e.g., the CPU 108,graphics processing unit 102, I/O subsystem, etc.) increases.

In one embodiment, thermald 110 selectively increases the selectiveforced idling for the lower QoS tasks before decreasing the higher QoStasks, so that CPU executions for lower QoS tasks are throttled beforethe higher QoS tasks. By selectively throttling the lower QoS task CPUexecutions, the CPU execution for the higher QoS tasks are notthrottled, but the overall CPU usage decreases, thus decreasing thepower consumption of the storage system for the device 100, anddecreasing the heat generated by the device, and reducing the thermalload on the device 100. If the thermal load on the device 100 continuesto increase, thermald 110 can either further throttle the lower QoStasks and/or start to throttle the higher QoS tasks. In one embodiment,thermald 110 throttles both the lower and higher QoS tasks. In anotherembodiment, as the thermal load of the device decreases, thermald 110lessens or removes the throttling of the lower and/or higher levels byrelaxing the constraints placed on the different QoS tasks. In thisembodiment, if the thermal load of the device lessens, thermald 110relaxes the selective forced idling of one, some, or all tasks to anormal state (e.g., no selective forced idle for that task). The CPUthrottling can occur by throttling either one, some or all of the CPU(s)108. In one embodiment, the setting of the selective forced idle fordifferent QoSes is performed by the CPU management module 114. Managingthe CPU executions for different QoS tasks is further described in FIG.7 below. In one embodiment, the kernel 112 that is a basic component ofthe operating system 112 and provides a level of abstraction for thedevice resources (e.g., tasks, input/output systems, network resources,etc.). In one embodiment, the kernel 110 schedules tasks for executionby the CPU(s) 108. In one embodiment, the kernel includes a CPUscheduler 116 that schedules the tasks for execution using the selectiveforce idle values for each of the tasks. In one embodiment, the CPU(s)108 include an SFI module 118 that executes the tasks using theselective forced idle values for each of the tasks.

FIG. 2 is a block diagram of a CPU 200 with multiple CPU processingcores 202A-D and supporting hardware 204. While in one embodiment, theCPU 200 includes four different CPU processing cores 202A-D, inalternate embodiments, the CPU 200 can include more or less CPUprocessing cores. In one embodiment, each CPU processing core 202A-D isan independent compute unit that can read and execute programinstructions at a particular execution frequency. In one embodiment,each of CPU processing cores 202A-D can either operate at the sameexecution frequency, if a task is scheduled to executed on that core, orcan be put in a lower power state (e.g., if no task scheduled or taskidle). In this embodiment, the low power state hibernates the CPU core202A-D, which reduces the amount of power used and heat generated by thedevice. Thus, in one embodiment, the CPU 200 can have some of the CPUcores 202A-D running and executing tasks and other CPU cores 202A-Dhibernating in a low power state. In addition, the CPU 200 includes CPUsupport hardware 204. In one embodiment, the CPU support hardware 204includes a memory controller, last level cache, CPU interconnects etc.In one embodiment, if all of the CPU 202A-D are idle, the CPU supportinghardware 204 can be put in a low power state and be power-gated toeliminate leakage current, further saving power and reducing the thermalload on the device.

In one embodiment, the CPU cores 202A-D can be put into the low powerstate for part of an execution window when executing a task. In thisembodiment, a task can be scheduled on one or more of the CPU cores202A-D to be executed during the executed window. During this executionwindow, the one or more of the CPU cores 202A-D can idle that executingtasks, so as to put the CPO core 202A-D into a low power state. Thispartial idling of the CPU core is called a selective forced idle asdescribed above. In one embodiment, a selective forced idle can beperformed based on the thermal load of the device and the QoS of theexecuting task.

FIG. 3 is an illustration of one embodiment of CPU core executiontimelines 300A-D that include selective forced idle for low QoS tasks.In one embodiment, CPU core 300A is executing a video task, which is ahigh QoS task. In this embodiment, the CPU core 300A executes the videotask for the entire execution window, with exception of a normal idle308. In one embodiment, a normal idle 308 during the course of normalexecution. For example and in one embodiment, if the high QoS task werea video playback task, the task would go idle on completion of a frame.In contrast, each of CPU cores 300B-C are executing low QoS tasks. Forexample and in one embodiment, CPU core 300B is executing a backup task302B, which is a low QoS task. Similarly, CPU core 300C is executinganother low QoS task, a search indexing task 302C. In these embodiments,each of the low QoS tasks a selectively forced idle is scheduled toreduce the thermal load on the device. For example and in oneembodiment, the backup task 302B is selectively forced idled during thetime period 304A and the search indexing task is selectively forcedidled during the time period 304B. In each of these forced idled timeperiods, the corresponding CPU cores can be put into a low power states,saving power and mitigating the thermal load on the device. In oneembodiment, the CPU core 300D is not scheduled to have a task executingduring this execution window and is in a low power state.

As described in FIG. 3, a low QoS task can be selectively forced idlefor part (or possibly all) of an execution window in order to mitigate athermal load on a device. Alternatively, if the thermal load is highenough, a high QoS task can be selectively forced idled as well. Aselectively force idle for a task idles the CPU processing core for aperiod of time during an execution window of a task. By idling theprocessing core, less power is consumed by the device and less heat isproduced. However, in FIG. 3, the selective forced idle time period donot overlap, such that all of the CPU processing cores are idling at thesame time. If all of the CPU processing cores can be idled over the sametime, the entire CPU can be put into a low power state, including theCPU supporting hardware. To do so, the selective forced idle times canbe pashed aligned such that the selective force idle time overlap toincrease the likelihood that a high QoS task (e.g., the video task 302Aof FIG. 3) idles during the overlapping selective forced idle times ofthe other tasks.

FIG. 4 is an illustration of one embodiment of CPU core executiontimelines 400A-D that are phase aligned overlapping selective forcedidle for low QoS tasks. In FIG. 4 and in one embodiment, CPU core 400Ais executing a video task, which is a high QoS task. In this embodiment,the CPU core 400A executes the video task for the entire executionwindow, with exception of a normal idle 408. In addition, each of theCPU cores 400B-C are executing low QoS tasks, a backup task 402B andsearching indexing task 402C, respectively. These two low QoS tasks402B-C have overlapping selective forced idle times 404A-B,respectively. By overlapping the forced idle times, it increases thelikelihood that all of the CPU cores are idle at the same time.Overlapping the selective forced idle times phase aligns the forcedidling times of these tasks 402B-C. The selective forced idling times ofthe low QoS tasks can be the same or different. For example and in oneembodiment, the backup task 402B is selectively forced idle during timeperiod 404A, which overlaps with the selectively forced idle time 404Bof the search indexing task 402C. In one embodiment, during theoverlapped selective forced idle times of tasks 402B-C, the video task402A idles during time period 408. Because all of the CPU cores 400A-Dare idle during this time period 408, the CPU can be put into a lowpower state, including any supporting CPU hardware (e.g., CPU 200 andCPU supporting hardware 204 as describe in FIG. 2 above).

FIG. 5 is an illustration of a table 500 of selective force idlepercentages for different levels of CPU throttling. In FIG. 5, the table500 includes a column 502 of QoS classes, column 504 that includes theprocess class, and columns 504A-C of different selective forced idlepercentages for different CPU throttling conditions. In one embodiment,the different QoS class assignments can be based on focality (foregroundstatus) of the application in question, whether the app has been “appnapped”, energy consumption history across the CPU, GPU and IO devicesand other criteria. Explicitly advertised classes include background,for long-running batch jobs such as filesystem indexing or encryption,backup etc., with the gamut QoS classes ranging up to user-interactiveand realtime execution such as scrolling and video/audio processing. Inone embodiment, QoS 0 is the highest QoS and QoS N is the lowest QoS. Inthis embodiment, each of these QoS classes can correspond to differentclasses of tasks. For example and in one embodiment, QoS 0 can be theclass of tasks related to foreground applications. QoS 1 can be tasksrelated to applications in the app nap state. QoS N can be tasks relatedto background applications.

Three different CPU throttling conditions are illustrated in FIG. 5. Inone embodiment, for the no CPU throttling condition 504A, not of theseQoSes is selectively forced idle. In this embodiment, this means thateach of the tasks is executed normally during the execution window. Thiscondition represents a device with little or no thermal load. In thisembodiment, each of the tasks will be scheduled for CPU execution andprocessed normally with no selective forced idling. As the thermal loadfor the device increases, the device starts to throttle the lower QoStasks. In one embodiment, this is illustrated the column 504B wherethere is some CPU throttling for the lower QoS tasks. For example in oneembodiment, QoS 0 executes normally with no forced idling. QoS 1 hasselective forced idling of 10%. This means, that for an executionwindow, a task with a QoS of 1, will be selectively forced idle for 10%of the execution window. In addition, QoSes 2 and N will be selectivelyforced idle for 25% and 50%, respectively. This illustrates the lowerQoS tasks getting potentially throttled by 10-50%. As the thermal loadfurther increases, each of the QoSes may have the CPU throttled further.For example in one embodiment, in column 504C, QoS 0 has a selectiveforced idle percentage of 10%, QoSes 1, 2, and N have a selective forcedidle percentages of 25, 50, and 75%, respectively. At this level, thelower QoSes are more selectively restricted, although still will getsome CPU execution time.

FIG. 6 is an illustration of execution windows 614A-C for two differenttasks with selective force idling applied to these tasks. In FIG. 6,tasks for a background process 610 and an application in app nap 612 areselectively forced idled during the execution windows 614A-C. In oneembodiment, during each execution window, each of the tasks is partiallyexecuted during the execution window. For example and in one embodiment,for the background task 610, the task is executed during the timeperiods 608A-C and idled during the time periods 606A-C. In thisexample, the background task 610 is idled for approximately 75% of theexecution windows 614A-C and executed for 25% of the execution windows614A-C. As anther example and embodiment, for the task in an applicationnap 610, the task is executed during the time periods 602A-C and idledduring the time periods 604A-C. In this example, the app nap task 612 isidled for approximately 50% of the execution windows 614A-C and executedfor 50% of the execution windows 614A-C.

FIG. 7 is a flow diagram of one embodiment of a process 700 to manageCPU throttling based on the thermal level of the device. In oneembodiment, process 700 is performed by a thermal daemon to manage CPUthrottling, such as thermald 112 as described above in FIG. 1. In FIG.7, process 700 begins by receiving the thermal level at block 702. Inone embodiment, the thermal level is the data related to the thermalprofile or other thermal characteristics of the device. For example inone embodiment, the thermal level can be time-dependent thermal levelregarding the device temperature, temperature of a particular module ofthe device, data regarding fan use, and/or other data related to thethermal characteristics of the device. At block 704, process 700determines if the thermal level is greater than a higher threshold. Inone embodiment, the higher threshold is a threshold that indicates thatthe device can have greater CPU throttling so as to mitigate the thermalload that is on the device. For example and in one embodiment, thethermal threshold can be related to the temperature of the device, amodule of the device, fan speed, or some other thermal characteristic.As another example and embodiment, a set of higher thermal thresholdcould be if the device temperature exceeded 40° C., 45° C., 50° C., etc.In another embodiment, the thermal threshold can be based on time of dayor user activity. For example and in one embodiment, if the user wasactively interacting with the device, the process 700 could choose tocontrol thermals more aggressively. If process 700 can predict that thedevice is not in actively in use (say at 2 a.m.) and will havesufficient time to cool down, activities which may have been delayedduring the day such as backups could be executed at a higher performancelevel. If the thermal level is greater than a higher threshold, process700 adjusts the selective forced idling for different task QoSes toincrease the CPU throttling at block 708 for each QoS class whosethermal threshold has been exceeded. In this embodiment, process 700 canstart to throttle a QoS or further throttle an already throttled QoS. Inone embodiment, process 700 throttles a QoS by increasing the selectiveforced idling percentages of a task with that QoS. For example in oneembodiment, process 700 can throttle a QoS by increasing a selectiveforced idling from 0% to 25% as described in FIG. 5 above.Alternatively, process 700 can throttle an already throttled QoS from25% up to 50%. By selectively increasing a forced idle for differentQoSes, process 700 selectively throttles the different QoSes, thusallowing greater CPU execution for higher QoSes and lower CPU executionfor lower QoSes. This allows for less power consumption of the CPU forthe device, while having better CPU throughput for higher QoS processesat the expense of CPU throughput lower QoS processes. A lower powerconsumption of the storage system can help mitigate the thermal load onthe device.

If the thermal level is not greater than a higher threshold, process 700determines if the thermal level is less than a lower threshold at block706. In one embodiment, if the thermal level is less than a lowerthreshold, process 700 may want to relax the CPU throttling as thethermal load on the device may be lessening. For example and in oneembodiment, if the current throttling is for a device with a temperatureof 40-45° C. and the temperature falls to below 40° C., which is a lowthermal load for the device, process 700 may relax the current CPUthrottling (e.g., by decreasing the selective forced idlingpercentages). If the thermal level is less than a lower threshold, atblock 710, process 700 adjusts the selective forced idling percentagesto decrease the CPU throttling. In one embodiment, process 700 relaxesthe restrictions placed on the CPU throughput for one or more of thedifferent QoSes. For example and in one embodiment, process 700 canrelax a QoS with a 25% selective forced idle back to an unrestricted 0%selective forced idle as described in FIG. 5 above. Alternatively,process 700 can relax a restricted QoS at a 50% selective forced idle toa less restricted 25% selective forced idle. If the thermal level is notless than the lower threshold, process 700 maintains the current CPUthrottling at block 712. Execution proceeds to block 712 above.

In addition to setting a selective forced idle value based on a QoS of atask, the device (e.g., device 100) can set a selective forced idlevalue based on historical energy consumption by the task. For exampleand in one embodiment, if a device has a high thermal load, the devicecan throttle historically high energy consuming tasks by setting theselective forced idle value for those tasks. In this embodiment, thedevice may throttle the CPU for historically high energy consuming tasksinstead having the thermal load affect important system or user tasks(e.g., Windows server, menu operations, virtual memory subsystem andother system components). FIG. 8 is a flow diagram of one embodiment ofa process 800 to manage CPU throttling for a high energy consuming taskbased on the thermal level of the device. In one embodiment, process 800is performed by a thermal daemon to manage CPU throttling for highenergy consuming tasks, such as thermald 112 as described above inFIG. 1. In FIG. 8, process 800 begins by receiving the thermal level atblock 802. In one embodiment, the thermal level is the data related tothe thermal profile or other thermal characteristics of the device. Forexample in one embodiment, the thermal level can be time-dependentthermal level regarding the device temperature, temperature of aparticular module of the device, data regarding fan use, and/or otherdata related to the thermal characteristics of the device. At block 804,process 800 determines if the thermal level is greater than a highenergy consuming threshold. In one embodiment, the high energy consumingthreshold is a threshold for a condition in which the device throttleshistorically high energy consuming tasks. By throttling historicallyhigh energy consuming tasks, the device mitigates the thermal load onthe device, even if the historically high energy consuming task is aforeground application. For example and in one embodiment, the thermalthreshold can be related to the temperature of the device, a module ofthe device, fan speed, or some other thermal characteristic. As anotherexample and embodiment, a set of higher thermal threshold could be ifthe device temperature exceeded 50° C. or greater.

At block 806, process 800 determines if there are tasks running that arehistorically high energy consuming tasks. For example and in oneembodiment, a video encoder/decoder/transcoder task may be ahistorically high energy consuming task. In one embodiment, process 800retrieves information about historical energy consumption informationfrom a database that tracks the energy consumption for previouslyrunning tasks. In one embodiment, the energy consumption data for a taskis the amount of energy that the device uses while executing that task.In this embodiment, the device tracks the energy consumption ofdifferent running applications. If there is a currently running taskthat is a historically high energy consuming task, at block 810, process800 marks this task as candidates for CPU throttling using selectiveforced idling. In one embodiment, process 800 marks a historically highenergy consuming tasks for CPU throttling by setting a selective forcedidling value of greater than 0%. For example and in one embodiment,process 800 would set a selective forced idling value of 50% for a videoencoding/decoding/transcoding task that is a historically high energyconsuming task. In this embodiment, the CPU scheduler would use thissetting to selectively force idle that task. If there are no tasksrunning with a history of high energy consumption, process 800 takes noaction at block 812.

If, at block 804, the thermal level is not greater than an energyconsumption threshold, process 800 unmarks any task that has been markedpreviously for selective forced idling based on historical energyconsumption at block 808. For example and in one embodiment, if thedevice's thermal level has fallen below the energy consumption thresholdand a video transcoding task has been selectively forced idle duebecause this task is a historically high energy consumer, the deviceunmarks that task and removes the forced idling of that task. While inone embodiment, there is one energy threshold, in alternate embodimentsthere can be multiple energy thresholds with varying degrees ofselective forced idle values.

As described above, the device can selectively restrict and relaxdifferent selective forced idle values in response to the thermal levelof the device. The device uses the different selective forced idlevalues to process the device CPU operations. FIG. 9 is a flow diagram ofone embodiment of a process 900 to schedule and execute tasks using CPUthrottling. In one embodiment, a CPU scheduler performs process 900 toschedule and execute the tasks using CPU throttling, such as CPUscheduler 116 as described above in FIG. 1. In FIG. 9, process 900begins by selecting a task to be run on each available CPU core. In oneembodiment, process 900 selects the tasks by selecting the availabletasks with the highest QoS. For example and in one embodiment, if thereare three tasks available, a high QoS video task, a low QoS backup task,and a low QoS search indexing task for four processing cores, process900 would select these three tasks on the three of the four processingcores. At block 904, process 900 schedules and phase aligns the selectedtasks on the different CPU cores. In one embodiment, each of theselected tasks may have selective forced idle times. In this embodiment,process 900 would schedule the selective forced idle times for eachapplicable tasks such that the forced idle times would overlap. In oneembodiment, the forced idle times of the tasks are maximally overlapped,such that forced idle times overlap as much as possible. In thisembodiment, by maximally overlapping the forced idle times, it increasesthe probability that all of the processing cores will be idle for partof the execution window. In one embodiment, the phase aligning of thetasks is further described in FIG. 10 below.

Processes 900 sets the CPU core executing frequency ceiling based on theQoS of scheduled tasks, thermal level thresholds for the QoS class andthermal level of device at block 906. In one embodiment, each of the CPUcore executes at a CPU frequency. The CPU core frequency ceiling can bethe same for all of the processing cores of a CPU or can be different.Setting the CPU core frequency ceiling is further described in FIG. 13below. At block 908, process 900 executes the tasks. In one embodiment,process 900 executes the tasks by having the CPU processing core executethe task during the non-idling time of the execution window for thattask. For example and in one embodiment, process 900 executes each taskduring the “on” portion of the execution window as described in FIG. 6above.

As described above, if the idling times of the selective forced idletasks overlap, the probability that all of the CPU processing cores ofthe CPU will idle at the same time increases. In one embodiment, thiscan be accomplished by phase aligning the forced idles times of theselective forced idle tasks. FIG. 10 is a flow diagram of one embodimentof a process 1000 to phase align tasks that are selective forced idle ondifferent CPU cores. In one embodiment, phase aligning is performed by aCPU scheduler such as the CPU scheduler 116 as described in FIG. 1above. In FIG. 10, process 1000 begins by receiving the scheduled tasksin the tasks selective forced idle values for those selected tasks atblock 1002. In one embodiment, the selective forced idle time valueseither are derived from task QoS value or the value is assigned (e.g.,historically high energy consumers as described in FIG. 8 above). Atblock 1004, and for each scheduled task, process 1000 determines theamount of time each task is forced idled (if any). In one embodiment, ifa task is to be selectively forced title, this means that a portion ofthe execution window for that task will be idle. In this embodiment,process 1000 determines the time period of the execution window for thattask where the task is force idled. For example in one embodiment, ifthe task is to be selectively force idled for 50% of the executionwindow, process 1000 determines that half of the execution window forthat task will be idle. Using the forced idle times of the scheduledtasks, process 1000 phase aligns the idle times so that the idle timesof these tasks overlap. In one embodiment, process 1000 phase aligns theforced idle times, such that each of the forced idle times overlap and asmaller forced idle time completely overlaps with a greater forced idletime. In this embodiment, the forced idle times maximally overlap andgive the greatest probability that all of the CPU processing cores in aCPU will idle at the same time. By idling all the CPU processing coresat the same time, each of the CPU processing cores can be put in alow-power state, and the supporting hardware of the CPU can be put in alow-power state as well.

FIG. 11 is a flow diagram of one embodiment of a process 1100 to manageCPU frequency ceilings based on the thermal level of the device. In oneembodiment, portable multicore systems provide a single CPU frequencyplane across all cores of that system. In other words, cores executingin parallel execute at the same frequency. On such systems, theselective task modulation mechanism improves energy efficiency inscenarios where tasks with heterogeneous QoSes are active in parallel.On systems without this invention, the lower quality-of-service tasksmust perforce execute at the high frequency appropriate to theperformance demands of the high quality-of-service task. In oneembodiment, by de-scheduling the lower QoS tasks in phase, the systemhas an opportunity to execute the lower QoS tasks during a period wherethe high QoS is not active, thus selecting a lower, more energyefficient processor frequency for the low QoS tasks. This can alsopotentially improve the performance of the higher quality-of-servicetasks by devoting more shared processing resources, including sharedprocessor caches, to the higher QoS task. In one embodiment, process1100 is performed by a thermal daemon to manage CPU throttling, such asthermald 112 as described above in FIG. 1. In FIG. 11, process 1100begins by receiving the thermal level at block 1102. In one embodiment,the thermal level is the data related to the thermal profile or otherthermal characteristics of the device. For example in one embodiment,the thermal level can be time-dependent thermal level regarding thedevice temperature, temperature of a particular module of the device,data regarding fan use, and/or other data related to the thermalcharacteristics of the device. At block 1104, process 1100 determines ifthe thermal level is greater than a higher threshold. In one embodiment,the higher threshold is a threshold that indicates that the device canhave greater CPU throttling by reducing a CPU core frequency so as tomitigate the thermal load that is on the device. For example and in oneembodiment, the thermal threshold can be related to the temperature ofthe device, a module of the device, fan speed, or some other thermalcharacteristic. As another example and embodiment, a set of higherthermal threshold could be if the device temperature exceeded 40° C.,45° C., 50° C., etc. In another embodiment, the thermal threshold can bebased on time of day or user activity. If the thermal level is greaterthan a higher threshold, process 1100 adjusts the selective forcedidling for different task QoSes to increase the CPU throttling byreducing a CPU core frequency ceiling at block 1108. In this embodiment,reducing the CPU core frequency ceiling will cause the CPU processingcore to execute as a lower frequency, thus reducing the power used bythe CPU processing core as well as reducing the thermal load on thedevice. In this embodiment, process 1100 can start to throttle anunrestricted QoS or further throttle an already throttled QoS. In oneembodiment, process 1100 throttles a QoS by decreasing the CPUprocessing frequency ceiling of that QoS. For example in one embodiment,process 1100 can throttle a QoS by decreasing a CPU processing frequencyceiling from 100% to 90% as described in FIG. 12 below. Alternatively,process 1100 can throttle an already throttled QoS from a 50% down to a25% CPU processing frequency ceiling. By selectively decreasing a CPUprocessing frequency ceiling for different QoSes, process 1100selectively throttles the different QoS, thus allowing greater CPUexecution for higher QoSes and lower CPU execution for lower QoSes. Thisallows for less power consumption of the CPU for the device, whilehaving better CPU throughput for higher QoS processes at the expense ofCPU throughput lower QoS processes. A lower power consumption of thestorage system can help mitigate the thermal load on the device.

If the thermal level is not greater than a higher threshold, process1100 determines if the thermal level is less than a lower threshold atblock 1106. If the thermal level is less than a lower threshold, atblock 1110, process 1100 adjusts the CPU processing frequency ceiling todecrease the CPU throttling. In one embodiment, process 1100 relaxes therestrictions placed on the CPU throughput for one or more of thedifferent QoS. For example and in one embodiment, process 1100 can relaxa QoS with a 75% CPU processing frequency ceiling back to anunrestricted 100% CPU processing frequency ceiling as described in FIG.12 below. Alternatively, process 1100 can relax a restricted QoS at a25% CPU processing frequency ceiling to a less restricted 50% selectiveforced idle. If the thermal level is not less than the lower threshold,process 1100 maintains the current CPU throttling at block 1112.Execution proceeds to block 1112 above.

FIG. 12 is an illustration of a table of frequency ceiling percentagesfor different levels of CPU throttling. In FIG. 12, table 1200 includesa column 1202 of QoS classes, column 1204 that includes the task class,and columns 1204A-C of different selective forced idle percentages fordifferent CPU throttling conditions. In one embodiment, QoS 0 is thehighest QoS and party N is the lowest QoS. In this embodiment, each ofthese QoSes can correspond to different classes of tasks. For exampleand in one embodiment, QoS 0 can be the class of tasks related toforeground applications. QoS 1 can be tasks related to applications inthe app nap state. QoS N can be tasks related to backgroundapplications.

Three different CPU throttling conditions are illustrated in FIG. 12. Inone embodiment, for the no CPU throttling condition 1204A, there is noreduction in the percent CPU percent frequency ceiling. In thisembodiment, this means that each of the tasks is executed normallyduring the execution window. This condition represents a device withlittle or no thermal load. In this embodiment, each of the tasks will bescheduled for CPU execution and processed normally with no CPUthrottling on the CPU processing core frequency. As the thermal load forthe device increases, the device starts to throttle the lower QoS tasks.In one embodiment, this is illustrated the column 1204B where there issome CPU throttling for the lower QoS tasks. For example in oneembodiment, QoS 0 and 1 execute normally with no reduction of the CPUprocessing core frequency. QoS 2 and N will have the CPU processing corefrequency ceiling reduced to 90% and 75%, respectively. This illustratesthe lower QoS processes getting potentially throttled by 10-25%. As thethermal load further increases, each of the QoSes will have the CPUthrottled further. For example in one embodiment, in column 1204C, QoS 0has a CPU processing core frequency ceiling of 90%, and QoSes 1, 2, andN have a CPU processing core frequency ceiling of 75, 50, and 25%,respectively. At this level, the lower QoSes are more selectivelyrestricted, although still will get some CPU execution time. In anotherembodiment, the higher QoS tasks (e.g., QoS 0) can be selectively idledas well.

FIG. 13 is a flow diagram of one embodiment of a process to set a CPUfrequency ceiling for a task on a CPU core. In one embodiment, a CPUscheduler performs process 900 to set a CPU frequency ceiling for a taskon a CPU core, such as CPU scheduler 116 as described above in FIG. 1.In FIG. 13, process 1300 begins by selecting a task to be run on eachavailable CPU core. In one embodiment, process 1300 selects the tasks bylooking at available tasks queued up and selecting the tasks withhighest QoS. At block 1304, process 1300 determines the CPU frequencyceiling for each task. In one embodiment, process 1300 determines theCPU frequency ceiling based on a task's QoS and the current devicethermal load. In one embodiment, the CPU frequency ceiling can be apercentage that is equal to or less than 100%. In one embodiment,process 1300 determines the task's CPU frequency ceiling using a tablelookup based on task QoS. Process 1300 sets the CPU frequency ceilingfor the CPU processing core at block 1306. In one embodiment, each ofthe CPU processing core have the same frequency. In this embodiment,process 1300 sets each processing core of the CPU to have the highestfrequency of one of the tasks to be executed on one of the CPUprocessing cores of that CPU. Alternatively, the CPU frequency ceilingcan be the lowest of one of the tasks to be executed on one of the CPUprocessing cores of that CPU. At block 1308, process 1300 executes thetasks using the CPU processing cores.

FIG. 14 is a block diagram of one embodiment of a CPU management module114 to manage CPU throttling based on the thermal level of the device.In one embodiment, the CPU management module 114 includes a CPUthrottling module 1402 and a CPU high energy throttling module 1404. Inone embodiment, the CPU throttling module 1402 manages CPU throttlingbased on the thermal level of the device as described in FIG. 7 above.In one embodiment, the CPU throttling module 1402 includes a receivethermal level module 1406, compare higher thermal threshold module 1408,compare lower thermal threshold module 1410, increase CPU throttlingmodule 1412, and decrease CPU throttling module 1414. In one embodiment,the receive thermal level module 1406 receives the thermal level asdescribed in FIG. 7, block 702 above. The compare higher thermalthreshold module 1408 compares the thermal level with a higher thermalthreshold as described in FIG. 7, block 704 above. The compare lowerthermal threshold module 1410 compares the thermal level with a lowerthermal threshold as described in FIG. 7, block 706 above. The increaseCPU throttling module 1412 increases the CPU throttling for one or moretasks as described in FIG. 7, block 708 above. The decrease CPUthrottling module 1414 decreases the CPU throttling for one or moreprocesses as described in FIG. 7, block 710 above.

In one embodiment, the CPU high energy throttling module 1404 managesCPU throttling for a high energy consuming task based on the thermallevel of the device as described in FIG. 8 above. In one embodiment, theCPU high energy throttling module 1404 includes a receive thermal levelmodule 1416, compare energy thermal threshold module 1418, unmark tasksmodule 1420, determine tasks module 1422, and mark task module 1424. Inone embodiment, the receive thermal level module 1416 receives thethermal level as described in FIG. 8, block 802 above. The compareenergy thermal threshold module 1418 compares the thermal level with anenergy threshold as described in FIG. 8, block 804 above. The unmarktasks module 1420 unmarks tasks for selective forced idling as describedin FIG. 8, block 808 above. The determine tasks module 1422 determinesif there are tasks running with a history of high energy consumption asdescribed in FIG. 8, block 806 above. The mark task module 1424 markstasks as candidates for CPU throttling using selective forced idling asdescribed in FIG. 8, block 810 above.

FIG. 15 is a block diagram of one embodiment of a CPU scheduler 116 toschedule and execute tasks using CPU throttling. In one embodiment, theCPU scheduler 116 includes a receive scheduled tasks module 1502,determine idle time module 1504, and phase align module 1506. In oneembodiment, the receive scheduled tasks module 1502 receives thescheduled tasks as described in FIG. 10, block 1002 above. The determineidle time module 1504 determines the forced idle times as described inFIG. 10, block 1004 above. The phase align module 1506 aligns the forcedidle times as described in FIG. 10, block 1006 above.

FIG. 16 is a block diagram of one embodiment of a CPU frequencymanagement module 1600 to manage CPU frequency ceilings based on thethermal level of the device. In one embodiment, the CPU frequencymanagement module 1600 includes a receive thermal level module 1602,compare higher frequency threshold module 1604, compare lower frequencythreshold module 1606, decrease CPU frequency ceiling module 1608, andincrease CPU frequency ceiling module 1610. In one embodiment, thereceive thermal level module 1602 receives the thermal level asdescribed in FIG. 11, block 1102 above. The compare higher frequencythreshold module 1604 compares the thermal level with a higher CPUfrequency threshold as described in FIG. 11, block 1104 above. Thecompare lower frequency threshold module 1606 compares the thermal levelwith a lower CPU frequency threshold as described in FIG. 11, block 1106above. The decrease CPU frequency ceiling module 1608 decreases the CPUfrequency ceiling for one or more tasks as described in FIG. 11, block1108 above. The increase CPU frequency ceiling module 1610 increases theCPU frequency ceiling for one or more processes as described in FIG. 11,block 1110 above.

FIG. 17 is a block diagram of one embodiment of a frequency ceilingmodule 1700 to set a CPU frequency ceiling for a task on a CPU core. Inone embodiment, the frequency ceiling module 1700 includes a selecttasks module 1702, determine task ceiling module 1704, set CPU coreceiling module 1706, and execute tasks module 1708. In one embodiment,the select tasks module 1702 selects a task to be run on each availableCPU core as described in FIG. 13, block 1302 above. The determine taskceiling module 1704 determines the frequency ceiling percentage for eachtask as described in FIG. 13, block 1304 above. The set CPU core ceilingmodule 1706 sets the frequency ceiling percentage as described in FIG.13, block 1306 above. The execute tasks module 1708 executes the tasksas described in FIG. 13, block 1308 above.

FIG. 18 shows one example of a data processing system 1800, which may beused with one embodiment of the present invention. For example, thesystem 1800 may be implemented including a device 100 as shown inFIG. 1. Note that while FIG. 18 illustrates various components of acomputer system, it is not intended to represent any particulararchitecture or manner of interconnecting the components as such detailsare not germane to the present invention. It will also be appreciatedthat network computers and other data processing systems or otherconsumer electronic devices, which have fewer components or perhaps morecomponents, may also be used with the present invention.

As shown in FIG. 18, the computer system 1800, which is a form of a dataprocessing system, includes a bus 1803 which is coupled to amicroprocessor(s) 1805 and a ROM (Read Only Memory) 1807 and volatileRAM 1809 and a non-volatile memory 1811. The microprocessor 1805 mayretrieve the instructions from the memories 1807, 1809, 1811 and executethe instructions to perform operations described above. The bus 1803interconnects these various components together and also interconnectsthese components 1805, 1807, 1809, and 1811 to a display controller anddisplay device 1818 and to peripheral devices such as input/output (I/O)devices which may be mice, keyboards, modems, network interfaces,printers and other devices which are well known in the art. Typically,the input/output devices 1815 are coupled to the system throughinput/output controllers 1813. The volatile RAM (Random Access Memory)1809 is typically implemented as dynamic RAM (DRAM), which requirespower continually in order to refresh or maintain the data in thememory.

The mass storage 1811 is typically a magnetic hard drive or a magneticoptical drive or an optical drive or a DVD ROM or a flash memory orother types of memory systems, which maintain data (e.g. large amountsof data) even after power is removed from the system. Typically, themass storage 1811 will also be a random access memory although this isnot required. While FIG. 18 shows that the mass storage 1811 is a localdevice coupled directly to the rest of the components in the dataprocessing system, it will be appreciated that the present invention mayutilize a non-volatile memory which is remote from the system, such as anetwork storage device which is coupled to the data processing systemthrough a network interface such as a modem, an Ethernet interface or awireless network. The bus 1803 may include one or more buses connectedto each other through various bridges, controllers and/or adapters as iswell known in the art.

FIG. 19 shows an example of another data processing system 1900 whichmay be used with one embodiment of the present invention. For example,system 1900 may be implemented as a device 100 as shown in FIG. 1. Thedata processing system 1900 shown in FIG. 19 includes a processingsystem 1911, which may be one or more microprocessors, or which may be asystem on a chip integrated circuit, and the system also includes memory1901 for storing data and programs for execution by the processingsystem. The system 1900 also includes an audio input/output subsystem1905, which may include a microphone and a speaker for, for example,playing back music or providing telephone functionality through thespeaker and microphone.

A display controller and display device 1909 provide a visual userinterface for the user; this digital interface may include a graphicaluser interface which is similar to that shown on a Macintosh computerwhen running OS X operating system software, or Apple iPhone whenrunning the iOS operating system, etc. The system 1900 also includes oneor more wireless transceivers 1903 to communicate with another dataprocessing system, such as the system 1900 of FIG. 19. A wirelesstransceiver may be a WLAN transceiver, an infrared transceiver, aBluetooth transceiver, and/or a wireless cellular telephony transceiver.It will be appreciated that additional components, not shown, may alsobe part of the system 1900 in certain embodiments, and in certainembodiments fewer components than shown in FIG. 19 may also be used in adata processing system. The system 1900 further includes one or morecommunications ports 1917 to communicate with another data processingsystem, such as the system 800 of FIG. 8. The communications port may bea USB port, Firewire port, Bluetooth interface, etc.

The data processing system 1900 also includes one or more input devices1913, which are provided to allow a user to provide input to the system.These input devices may be a keypad or a keyboard or a touch panel or amulti touch panel. The data processing system 1900 also includes anoptional input/output device 1915 which may be a connector for a dock.It will be appreciated that one or more buses, not shown, may be used tointerconnect the various components as is well known in the art. Thedata processing system shown in FIG. 19 may be a handheld computer or apersonal digital assistant (PDA), or a cellular telephone with PDA likefunctionality, or a handheld computer which includes a cellulartelephone, or a media player, such as an iPod, or devices which combineaspects or functions of these devices, such as a media player combinedwith a PDA and a cellular telephone in one device or an embedded deviceor other consumer electronic devices. In other embodiments, the dataprocessing system 1900 may be a network computer or an embeddedprocessing device within another device, or other types of dataprocessing systems, which have fewer components or perhaps morecomponents than that shown in FIG. 19.

At least certain embodiments of the inventions may be part of a digitalmedia player, such as a portable music and/or video media player, whichmay include a media processing system to present the media, a storagedevice to store the media and may further include a radio frequency (RF)transceiver (e.g., an RF transceiver for a cellular telephone) coupledwith an antenna system and the media processing system. In certainembodiments, media stored on a remote storage device may be transmittedto the media player through the RF transceiver. The media may be, forexample, one or more of music or other audio, still pictures, or motionpictures.

The portable media player may include a media selection device, such asa click wheel input device on an iPod® or iPod Nano® media player fromApple, Inc. of Cupertino, Calif., a touch screen input device,pushbutton device, movable pointing input device or other input device.The media selection device may be used to select the media stored on thestorage device and/or the remote storage device. The portable mediaplayer may, in at least certain embodiments, include a display devicewhich is coupled to the media processing system to display titles orother indicators of media being selected through the input device andbeing presented, either through a speaker or earphone(s), or on thedisplay device, or on both display device and a speaker or earphone(s).Examples of a portable media player are described in published U.S. Pat.No. 7,345,671 and U.S. published patent number 2004/0224638, both ofwhich are incorporated herein by reference.

Portions of what was described above may be implemented with logiccircuitry such as a dedicated logic circuit or with a microcontroller orother form of processing core that executes program code instructions.Thus processes taught by the discussion above may be performed withprogram code such as machine-executable instructions that cause amachine that executes these instructions to perform certain functions.In this context, a “machine” may be a machine that converts intermediateform (or “abstract”) instructions into processor specific instructions(e.g., an abstract execution environment such as a “virtual machine”(e.g., a Java Virtual Machine), an interpreter, a Common LanguageRuntime, a high-level language virtual machine, etc.), and/or,electronic circuitry disposed on a semiconductor chip (e.g., “logiccircuitry” implemented with transistors) designed to executeinstructions such as a general-purpose processor and/or aspecial-purpose processor. Processes taught by the discussion above mayalso be performed by (in the alternative to a machine or in combinationwith a machine) electronic circuitry designed to perform the processes(or a portion thereof) without the execution of program code.

The present invention also relates to an apparatus for performing theoperations described herein. This apparatus may be specially constructedfor the required purpose, or it may comprise a general-purpose computerselectively activated or reconfigured by a computer program stored inthe computer. Such a computer program may be stored in a computerreadable storage medium, such as, but is not limited to, any type ofdisk including floppy disks, optical disks, CD-ROMs, andmagnetic-optical disks, read-only memories (ROMs), RAMs, EPROMs,EEPROMs, magnetic or optical cards, or any type of media suitable forstoring electronic instructions, and each coupled to a computer systembus.

A machine readable medium includes any mechanism for storing ortransmitting information in a form readable by a machine (e.g., acomputer). For example, a machine readable medium includes read onlymemory (“ROM”); random access memory (“RAM”); magnetic disk storagemedia; optical storage media; flash memory devices; etc.

An article of manufacture may be used to store program code. An articleof manufacture that stores program code may be embodied as, but is notlimited to, one or more memories (e.g., one or more flash memories,random access memories (static, dynamic or other)), optical disks,CD-ROMs, DVD ROMs, EPROMs, EEPROMs, magnetic or optical cards or othertype of machine-readable media suitable for storing electronicinstructions. Program code may also be downloaded from a remote computer(e.g., a server) to a requesting computer (e.g., a client) by way ofdata signals embodied in a propagation medium (e.g., via a communicationlink (e.g., a network connection)).

The preceding detailed descriptions are presented in terms of algorithmsand symbolic representations of operations on data bits within acomputer memory. These algorithmic descriptions and representations arethe tools used by those skilled in the data processing arts to mosteffectively convey the substance of their work to others skilled in theart. An algorithm is here, and generally, conceived to be aself-consistent sequence of operations leading to a desired result. Theoperations are those requiring physical manipulations of physicalquantities. Usually, though not necessarily, these quantities take theform of electrical or magnetic signals capable of being stored,transferred, combined, compared, and otherwise manipulated. It hasproven convenient at times, principally for reasons of common usage, torefer to these signals as bits, values, elements, symbols, characters,terms, numbers, or the like.

It should be kept in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. Unlessspecifically stated otherwise as apparent from the above discussion, itis appreciated that throughout the description, discussions utilizingterms such as “monitoring,” “decreasing,” “increasing,” “maintaining,”“executing,” “processing,” “scheduling,” “throttling,” “restoring,” orthe like, refer to the action and processes of a computer system, orsimilar electronic computing device, that manipulates and transformsdata represented as physical (electronic) quantities within the computersystem's registers and memories into other data similarly represented asphysical quantities within the computer system memories or registers orother such information storage, transmission or display devices.

The processes and displays presented herein are not inherently relatedto any particular computer or other apparatus. Various general-purposesystems may be used with programs in accordance with the teachingsherein, or it may prove convenient to construct a more specializedapparatus to perform the operations described. The required structurefor a variety of these systems will be evident from the descriptionbelow. In addition, the present invention is not described withreference to any particular programming language. It will be appreciatedthat a variety of programming languages may be used to implement theteachings of the invention as described herein.

The foregoing discussion merely describes some exemplary embodiments ofthe present invention. One skilled in the art will readily recognizefrom such discussion, the accompanying drawings and the claims thatvarious modifications can be made without departing from the spirit andscope of the invention.

What is claimed is:
 1. A non-transitory machine-readable medium havingexecutable instructions to cause one or more processing units to performa method to manage a thermal profile of a device, the method comprising:monitoring thermal level of the thermal profile of the device, whereinthe device is executing a plurality of tasks that utilize a centralprocessing unit (CPU) of the device and the plurality of tasks includinga high quality of service (QoS) task and a low QoS task, wherein thehigh QoS task and the low QoS task have a different QoS level and a QoSfor a task is derived from at least one characteristic of that task; inresponse to the thermal level of the device exceeding a first thermalthreshold, increasing a first CPU throttling for the low QoS task, andmaintaining a second CPU throttling for the high QoS task; executing thelow QoS task using the first CPU throttling with a first processing coreof the CPU by selectively forcing an idle of the low QoS task during anexecution window; and executing the high QoS task using the second CPUthrottling with a second processing core of the CPU, wherein the firstand second CPU throttling are each a different selective forced idlepercentage that results in a corresponding CPU utilization less than themaximum operating frequency of the CPU.
 2. The non-transitorymachine-readable medium of claim 1, wherein a CPU throttling sets anamount of selective forced idling used for a task when that task isexecuted by the CPU.
 3. The non-transitory machine-readable medium ofclaim 2, wherein a selective forced idle is an amount of time during theexecution window that a task is not being executed.
 4. Thenon-transitory machine-readable medium of claim 2, further comprising:putting the first processing core in a low power state during the selectforced idle.
 5. The non-transitory machine-readable medium of claim 1,in response to the thermal level of the device exceeding a secondthermal threshold, further increasing the first CPU throttling; andincreasing the second CPU throttling, wherein the second CPU throttlingis less than the first CPU throttling.
 6. The non-transitorymachine-readable medium of claim 5, in response to the thermal levelfalling below the second thermal threshold, restoring the first andsecond CPU throttling to previous values.
 7. The non-transitorymachine-readable medium of claim 1, wherein the thermal level isselected from the group consisting of device temperature and audible fannoise.
 8. The non-transitory machine-readable medium of claim 1, whereinthe high QoS task is foreground task and the low QoS is a batch task. 9.The non-transitory machine-readable medium of claim 1, wherein themonitoring of the thermal level comprises: recording a devicetemperature.
 10. A non-transitory machine-readable medium havingexecutable instructions to cause one or more processing units to performa method to manage a thermal profile of a device, the method comprising:monitoring thermal level of the thermal profile of the device, whereinthe device is executing a plurality of tasks that utilize a plurality ofprocessing cores of the device and the plurality of tasks includingmultiple low QoS tasks; scheduling the plurality of tasks on theplurality of processing cores for an execution window, wherein each ofthe multiple low QoS tasks are selectively forced idled at zeropercentage during the execution window and the forced idled times of themultiple low QoS tasks overlap and the execution window is a time periodin which the plurality of tasks are scheduled for execution on theplurality of processing cores; and executing the plurality of tasks. 11.The non-transitory machine-readable medium of claim 10, wherein aselective forced idle for one of the plurality of tasks is an amount oftime during the execution window when that task is not being executed.12. The non-transitory machine-readable medium of claim 10, wherein thescheduling further comprises: overlapping the selective force idles forone of the multiple low QoS tasks with another one of the multiple lowQoS tasks.
 13. The non-transitory machine-readable medium of claim 12,wherein each of the multiple low QoS tasks are selectively forced idleat a same point in the execution window.
 14. A method to manage athermal profile of a device, the method comprising: monitoring thermallevel of the thermal profile of the device, wherein the device isexecuting a plurality of tasks that utilize a central processing unit(CPU) of the device and the plurality of tasks including a high qualityof service (QoS) task and a low QoS task, wherein the high QoS task andthe low QoS task have a different QoS level and a QoS for a task isderived from at least one characteristic of that task; in response tothe thermal level of the device exceeding a first thermal threshold,increasing a first CPU throttling for the low QoS task, and maintaininga second CPU throttling for the high QoS task; executing the low QoStask using the first CPU throttling with a first processing core of theCPU by selectively forcing an idle of the low QoS task during anexecution window; and executing the high QoS task using the second CPUthrottling with a second processing core of the CPU, wherein the firstand second CPU throttling are each a different selective forced idlepercentage that results in a corresponding CPU utilization less than themaximum operating frequency of the CPU.
 15. The method of claim 14,wherein a CPU throttling sets an amount of selective forced idling usedfor a task when that task is executed by the CPU.
 16. The method ofclaim 15, wherein a selective forced idle is an amount of time duringthe execution window that a task is not being executed.
 17. The methodof claim 15, further comprising: putting the first processing core in alow power state during the select forced idle.
 18. A method to manage athermal profile of a device, the method comprising: monitoring thermallevel of the thermal profile of the device, wherein the device isexecuting a plurality of tasks that utilize a plurality of processingcores of the device and the plurality of tasks including multiple lowQoS tasks; scheduling the plurality of tasks on the plurality ofprocessing cores for an execution window, wherein each of the multiplelow QoS tasks are selectively forced idled at zero percentage during theexecution window and the forced idled times of the multiple low QoStasks overlap and the execution window is a time period in which theplurality of tasks are scheduled for execution on the plurality ofprocessing cores; and executing the plurality of tasks.